<div class="md-modal md-effect-2" id="modal-2">
	<div class="md-content">
		<div class="modal-header">
			<button class="md-close close" >&times;</button>
			<h4 class="modal-title">预约订单修改页面</h4>
		</div>
		<div class="modal-body">
			<div class="main-box-body clearfix"   style="height: 300px; overflow-y: scroll; overflow-x: hidden; " >
				<form class="form-horizontal" role="form">
					<div class="form-group">
							<label class="col-lg-2 control-label">订单人姓名</label>
							<div class="col-lg-6">
								<input value=" "  type="text"  class="form-control" ng-model="newOrder.name"/>
							</div>
						</div>
						<div class="form-group" >
							<label class="col-lg-2 control-label">联系电话</label>
							<div class="col-lg-6">
								<input type="text" class="form-control"  value="" ng-model="newOrder.phone"/>
							</div>
						</div>
						<div class="form-group">
							<label class="col-lg-2 control-label">预约时间</label>
							<div class="col-lg-6">
								<input type="text" class="form-control" id="yuyuetime" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"  ng-model="newOrder.time"  placeholder="请输入预约时间">
							</div>
							
						</div>
						<div class="form-group" >
							<label class="col-lg-2 control-label">联系地址</label>
							<div class="col-lg-6">					
								<input type="text" class="form-control"   value="" ng-model="newOrder.address"/>
							</div>
						</div>
						<div class="form-group" >

							<label class="col-lg-2 control-label">服务项目</label>
							<div class="col-lg-2">			
								<select  class="form-control"  ng-model="newOrder.serviceType1" ng-options="s1.code as s1.title for s1 in serviceList1" ng-change="getserviceType2(newOrder.serviceType1,'2')">
									<option value="">请选择服务项目</option>
								</select>
							</div>
							<div class="col-lg-2">					
								<select  class="form-control"  ng-model="newOrder.serviceType2" ng-change="getserviceType3(newOrder.serviceType2,'2')" ng-options="s2.code as s2.title for s2 in serviceList2">
									<option value="">请选择服务项目</option>
								</select>
							</div>
							<div class="col-lg-2">					
								<select  class="form-control"  ng-model="newOrder.serviceType3" ng-change="getFilterCompany(newOrder.serviceType3)" ng-options="s3.code  as s3.title for s3 in serviceList3">
									<option value="">请选择服务项目</option>
								</select>
							</div>
						</div>
						<div class="form-group" >
							<label class="col-lg-2 control-label">订单详情</label>
							<div class="col-lg-6">					
								<input type="text" class="form-control"  value="" ng-model="newOrder.detail"/>
							</div>
						</div>

						<div class="form-group">
							<label class="col-lg-2 control-label">是否试工</label>
							<div class="col-lg-6">
								<div class="checkbox-nice checkbox-inline"  >
									<input id="checkbox-in3-123456" type="checkbox"  ng-true-value="1"   ng-false-value="0"  ng-model="newOrder.is_trial">
									<label for="checkbox-in3-123456">
										是
									</label>
								</div>
								
							</div>
						</div>
				</form>
			</div>
		</div>
		<div class="modal-footer">
			
			<a class="btn btn-success " ng-click="editReservationCompany(newOrder)">生成订单</a>
		</div>
	</div>
</div>

<div class="col-lg-12">
	<!--当前位置 start-->
	<div class="row">
		<div class="col-lg-12">
			<ol class="breadcrumb">
				<li><a><i class="fa fa-home mrg-r-sm"></i>首页</a></li>
				<li class="active"><span>预约订单列表</span></li>
			</ol>
		</div>
		<div class="clearfix">
			<div class="filter-block pull-left">
				<!--搜索框 Start1-->
				<div class="form-group pull-left">
					<input type="text" class="form-control" ng-model="search.username"  placeholder="请输入联系人">
				</div>
				<div class="form-group pull-left">
					<input type="text" class="form-control" ng-model="search.telephone" 
						onkeyup="value=value.replace(/[^\d]/g,'') " 
                        onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" 
						 placeholder="请输入电话">
				</div>
				<div class="form-group pull-left">
					<input type="text" class="form-control" ng-model="search.servant_name"  placeholder="请输入服务人员">
				</div>
				<div class="form-group pull-left">
					<input type="text" class="form-control"  id="create_time"   onclick="laydate({istime: true, format: 'YYYY-MM-DD'})" ng-model="search.create_time"  placeholder="服务创建时间">
				</div>
				<div class="form-group pull-left">
					<input type="text" class="form-control"  id="time"   onclick="laydate({istime: true, format: 'YYYY-MM-DD'})" ng-model="search.time"  placeholder="服务预约时间">
				</div>
				<div class="form-group pull-left">
				    <select class="form-control"  ng-model="search.service1" ng-click="getserviceType2(search.service1.code)" ng-options=" service1 as service1.title for service1 in serviceList" >
						<option value="">请选择服务项目</option>
					</select>
				</div>
				<div class="form-group pull-left">
					<select class="form-control"  ng-model="search.service2" ng-click="getserviceType3(search.service2.code)"  ng-options=" service2 as service2.title for service2 in serviceList2" >
						<option value="">请选择服务项目</option>
					</select>
				</div>
				<div class="form-group pull-left">
					<select class="form-control"  ng-model="search.service3"   ng-options=" service3 as service3.title for service3 in serviceList3" >
						<option value="">请选择服务项目</option>
					</select>
				</div>
				<div class="form-group pull-left">
					<select class="form-control" ng-model="search.orderstatus">
						<option value="">请选择预约状态</option>
						<option value="3">待受理</option>
						<option value="1">已受理</option>
						<option value="0">已取消</option>
					</select>
				</div>
				<!--搜索框 End1-->
				<a class="btn btn-success pull-left form-group" ng-click="query(search)"  >
				 搜索
				 </a>
			</div>
		</div>		
		
	</div>
	<!--当前位置 end-->

	<!--代码写在这里-->
	<div class="row">
		<div class="col-lg-12">
			<div class="main-box no-header clearfix">

				<div class="main-box-body clearfix">
					<div class="table-responsive">
						<table class="table table-hover table-striped text-center">
							<thead>
								<tr>
									<th class="text-center"><span>联系人</span></th>
									<th class="text-center"><span>联系电话</span></th>
									<th class="text-center"><span>服务项目</span></th>
									<th class="text-center"><span>服务人员</span></th>
									<th class="text-center"><span>服务创建时间</span></th>
									<th class="text-center"><span>服务预约时间</span></th>
									<th class="text-center"><span>预约状态</span></th>
									<th class="text-center"><span>操作</span></th>
								</tr>
							</thead>
							<tbody>
								<tr role="row" class="odd" ng-repeat="item in list" id="{{item.code}}" on-finish-render-filters>
									<td>{{item.name}}</td>
									<td>{{item.phone}}</td>
									<td>{{item.serviceType1_title}}&nbsp;{{item.serviceType2_title}}&nbsp;{{item.serviceType3_title}}</td>
									<td>{{item.servant_name}}</td>
									<td>{{item.create_time}}</td>
									<td>{{item.time}}</td>
									<td>
									    <span ng-if="item.status=='3'" class="label label-warning">待受理</span>
						            	<span ng-if="item.status=='1'" class="label label-success">已受理</span>
						            	<span ng-if="item.status=='0'" class="label label-danger">已取消</span>
									</td>
									<td>
										<a ng-if="item.status!=0&&item.status!=1"  class="md-trigger  table-link  " data-modal="modal-2" ng-click="edit( item )">
	                                        <span class="fa-stack">
                                            <i class="fa fa-square fa-stack-2x"></i>
                                            <i class="fa fa-check fa-stack-1x fa-inverse"></i>
                                        </span>
	                                        
                                    	</a>
										
										<a ng-if="item.status!=0&&item.status!=1"  class="  table-link  danger "   ng-click="updatersv(item)">
	                                        <span class="fa-stack">
	                                            <i class="fa fa-square fa-stack-2x"></i>
	                                            <i class="fa fa-ban fa-stack-1x fa-inverse"></i>
	                                        </span>
	                                        
                                    	</a>
                                    	<a ng-if="item.status==0"  class="  table-link  default "   >
	                                        <span class="fa-stack">
	                                        	<i class="fa fa-square fa-stack-2x"></i>
	                                            <i class="fa fa-ban fa-stack-1x fa-inverse"></i>
	                                        	
	                                        </span>
                                    	</a>
                                    	<a ng-if="item.status==1"  class="  table-link  default "   >
	                                        <span class="fa-stack">
                                                <i class="fa fa-square fa-stack-2x"></i>
                                                <i class="fa fa-check fa-stack-1x fa-inverse"></i>
	                                        </span>
                                    	</a>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<ul class="pagination pull-right">
						<li><a >总条数：{{count}}</a></li>
						<li><a >总页数：{{totalPage}}</a></li>
						<li><a ng-click="changePage(1)">首页</a></li>
						<li><a ng-show="currentPage>1" ng-click="changePage(currentPage-1)"><i class="fa fa-chevron-left"></i></a></li>
						<!--<li><span ng-show="frontdotShow">…</span></li>-->
						<li ng-repeat="item in pageList" ng-click="changePage(item.number)" class="{{item.active}}"><a>{{item.number}}</a></li>
						<!--<li><span ng-show="backdotShow">…</span></li>-->
						<li><a ng-show="currentPage<totalPage" ng-click="changePage(currentPage+1)"><i class="fa fa-chevron-right"></i></a></li>
						<li><a ng-click="changePage(totalPage)">尾页</a></li>
					</ul>
				</div>
			</div>
		</div>
	</div>

	<!--代码写在这里  end-->
</div>

<div class="md-overlay"></div>

<script src="../default/js/modernizr.custom.js"></script>
<script src="../default/js/classie.js"></script>
<script src="../default/js/modalEffects.js"></script>
<script type="text/javascript">
	function init() {
		var overlay = document.querySelector('.md-overlay');
		[].slice.call(document.querySelectorAll('.md-trigger')).forEach(function(el, i) {
			var modal = document.querySelector('#' + el.getAttribute('data-modal')),
				close = modal.querySelector('.md-close');
			function removeModal(hasPerspective) {
				classie.remove(modal, 'md-show');
				if (hasPerspective) {
					classie.remove(document.documentElement, 'md-perspective');
				}
			}
	
			function removeModalHandler() {
				removeModal(classie.has(el, 'md-setperspective'));
			}
			el.addEventListener('click', function(ev) {
				classie.add(modal, 'md-show');
				overlay.removeEventListener('click', removeModalHandler);
				overlay.addEventListener('click', removeModalHandler);
				if (classie.has(el, 'md-setperspective')) {
					setTimeout(function() {
						classie.add(document.documentElement, 'md-perspective');
					}, 25);
				}
			});
			close.addEventListener('click', function(ev) {
				ev.stopPropagation();
				removeModalHandler();
			});
			$(document).keyup(function(e) {
				if (e.keyCode == 27) {
					e.stopPropagation();
					removeModalHandler();
				}
			});
		});
	}
	function closeMod(){
		$(".md-close").click();
	}
</script>